DEFINITION MODULE Lists;

FROM SYSTEM IMPORT ADDRESS;

TYPE
 NodePtr = POINTER TO Node;
 ListPtr = POINTER TO List;

 Node = RECORD
  prevEntry : NodePtr;
  nextEntry : NodePtr;
  list      : ListPtr;
 END (* RECORD *);

 List = RECORD
  firstEntry : NodePtr;
  lastEntry  : NodePtr;
 END (* RECORD *);

PROCEDURE AddHead(list : ListPtr; entry : NodePtr);
PROCEDURE AddTail(list : ListPtr; entry : NodePtr);
PROCEDURE NewList(list : ListPtr);
PROCEDURE Remove(entry : NodePtr);
PROCEDURE GetNext(node : NodePtr) : ADDRESS;
PROCEDURE GetPrev(node : NodePtr) : ADDRESS;

END Lists.
